A video coding apparatus is an apparatus that executes a coding process conforming to a predetermined video coding system on externally input video data and generates a bit stream. Video coding systems being used for coding processes in video coding apparatus include the Advanced Video Coding System (which is an advanced moving image compression coding system). This system conforms to the MPEG (Moving Picture Experts Group)-4 Standard—Part 10 and the Joint Model System is known as a reference model for coding. Ordinary video coding apparatus based on the Joint Model System will be referred to as the first related technique of the present invention hereinafter.
FIG. 3 of the accompanying drawings schematically illustrated a video coding apparatus of the first related technique, showing the configuration thereof. The video coding apparatus 100 of the first related technique includes an image frame buffer 102 for sequentially storing image frames that constitutes video data 101 to be compressed. Video data 103 having macroblocks as units formed by dividing an image into image regions of a predetermined size is output from the image frame buffer 102. The video data 103 is input to a macroblock encoder 104, which encodes the video on a macroblock by macroblock basis. The macroblock encoder 104 is connected to a code quantity control unit 105 and a decoded picture buffer 106 for storing a plurality of reference images for the purpose of motion compensation. The decoded picture buffer 106 is also connected to a predictor 112. The macroblock encoder 104 outputs a coded picture stream 107. A macroblock and a picture will be defined hereinafter.
The macroblock encoder 104 of the video coding apparatus 100 having the above-described configuration is formed by the macroblock buffer 111 for receiving video data 103 as input, the predictor 112 for predicting a motion connected to it, a first arithmetic unit 113 for subtracting the output of the predictor 112 from the output of the macroblock buffer 111, a converter/quantizer 114 for converting and quantizing the results of the arithmetic operation of the first arithmetic unit 113 under the control of the coded quantity control unit 105, an entropy encoder 115, an inverse quantizer/inverse converter 116, the entropy encoder 115 and the inverse quantizer/inverse converter 116 being arranged at the output side of the converter/quantizer 114, and a second arithmetic unit 117 arranged at the output side of the inverse quantizer/inverse converter 116 for additions.
It is assumed here that the video signal format of the video data 101 input to the video coding apparatus 100 is the QCIF (quarter common intermediate format). The QCIF is one of the video signal formats defined by the ITU (International Telecommunication Union).
FIG. 4 of the accompanying drawings schematically illustrates an image frame of the video signal format, or the QCIF. A QCIF image frame has 176×144 macroblocks. The image of a frame is formed by a frame picture in the case of progressive scanning. It is formed by two frame pictures in the case of interlaced scanning. In the following description, either frame picture will be simply referred to as a picture.
A macroblock that is a unit for forming a picture is by turn formed by 16×16 luminance pixels and 8×8 Cr (color difference signal) and Cb (color difference signal) color difference pixels. FIG. 4 shows the luminance positions (x) and the color difference positions (o) of a 4×4 pixel block formed by dividing a macroblock of 16×16 pixels by 16.
The macroblock encoder 104 illustrated in FIG. 3 of the accompanying drawings is designed to encode video data 103, using a macroblock as unit. The video data is coded progressively as it is raster scanned from the upper left corner to the lower right corner as in the case of raster scanning of television.
Firstly, the macroblock buffer 111 of the macroblock encoder 104 reads in the video data 103 to be coded on a macroblock by macroblock basis so as to temporarily accumulate the data and supply it to the downstream converter/quantizer 114. At this time, the first arithmetic unit 113 operates to subtract a predicted image 122 output from the predictor 112 from the image 121 of the macroblocks read out from the macroblock buffer 111 and supplies the predicted error image 123 that is obtained as a result of the arithmetic operation to the converter/quantizer 114.
The converter/quantizer 114 operates for frequency conversion of the predicted error image 123 by a unit smaller than a macroblock. Then, it converts the predicted error image 123 from a space region into a frequency region. According to the AVC (advanced Video Coding) Standard, frequency conversion can be utilized for luminance pixels by a unit of 8×8 or 4×4 blocks. A predicted error image converted into a frequency region is referred to as conversion coefficient hereinafter. A conversion coefficient is quantized according to the quantization parameter 125 supplied from the code quantity control unit 105 and then supplied to the entropy encoder 115 and the inverse quantizer/inverse converter 116 as code data 126. The entropy encoder 115 is a compression device that operates for compression by assigning a code having a length that varies as a function of the level of probability of generation of data. The quantization parameter 125 is supplied also to the entropy encoder 115.
The inverse quantizer/inverse converter 116 inversely quantizes the quantized value supplied from the converter/quantizer 114 and then operates for invert frequency conversion thereof before returning it to the original space region. Then, a decoded image 128 is obtained by adding the predicted image 122 supplied from the predictor 112 to the predicted error image returned to the space region at the second arithmetic unit 117. The decoded image 128 is stored in the decoded picture buffer 106 for a subsequent coding operation.
The entropy encoder 115 operates for entropy coding of the input code data 126 and outputs a bit stream 107. The present invention closely relates to the entropy encoder 115 and hence it will be described in detail hereinafter.
The predictor 112 supplies a generation parameter of predicted image to the entropy encoder 115 as code data 129. The generation parameter of predicted image may be a prediction mode such as inter-frame prediction mode or intra-frame prediction mode, an index of a decoded frame used for inter-frame prediction, a motion vector used for inter-frame prediction or an intra-frame predictive direction used for intra-frame prediction.
The decoded picture buffer 106 stores the decoded image 128 supplied from the inverse quantizer/inverse converter 116 as pointed out above and manages the decoded image picture reconstructed by using it.
The code quantity control unit 105 monitors the bit stream 131 output from the entropy encoder 115 for coding a picture by a target number of bits. Then, if the number of bits of the output bit stream 131 is greater than the target number of bits, it outputs a parameter that increases the quantization step size as the quantization parameter 125. Conversely, if the number of bits of the output bit stream 131 is smaller than the target number of bits, it outputs a parameter that decreases the quantization step size as the quantization parameter 125.
The first related technique of the present invention employs CABAC (context-based adaptive binary arithmetic coding) for the entropy encoder 115 for entropy coding just like the present invention. With this coding technique, the number of symbols (bins) input to an arithmetic encoder, which will be described in detail hereinafter, is also monitored. Then, the quantization parameter is adjusted so as to make the ratio of the number of bits to the number of bins meet the requirement of ratio defined in the above-cited AVC Standard.
FIG. 5 of the accompanying drawings is a schematic block diagram of an entropy encoder that can be used with the first related technique of the present invention illustrated in FIG. 3, showing the configuration thereof. The entropy encoder 115 includes a binarizer 141 for binarizing the code data 126 supplied from the converter/quantizer 114 shown in FIG. 3 and a context initializer 143 for receiving the quantization parameter 125 output from the code quantity control unit 105 as input. The quantization parameter 125 is also output to the outside of the entropy encoder 115 simply as it is as slice quantization parameter.
The binarizer 141 converts the input code data 126 into a binary string 144 according to the sequence defined in the H.264 Standard that is a standard for compression coding system of moving image data. The symbol (bin) of the binary string output from a switch 145 that operates for receiving the binary string 144 as input and also for switching is then input to an arithmetic encoder 148 and a context updater 149. The context initializer 143 receives the quantization parameter 125 as input and then it inputs an initialization signal 151 to the context updater 149 and initializes the context variable information at the head of a slice having a predetermined number of macroblocks that is a decoding unit of the above-described CABAC. The context updater 149 supplies the most probable symbol 152 and the state number 153 that are stored and correspond to the symbol 147 supplied to the arithmetic encoder 148 to the arithmetic encoder 148.
The arithmetic encoder 148 operates for binary arithmetic coding of the symbol 147 of the binary string that is sequentially supplied from the switch 145, utilizing the most probable symbol 152 and the state number 153 supplied from the context updater 149. A state number 153 is the number of the table that stores the value corresponding to the generation probability of a least probable symbol defined in the AVC (Advanced Video Coding) Standard. The most probable symbol 152 and the state number 153 that are updated by the operation of binary arithmetic coding of the arithmetic encoder 148 are stored in the context updater 149.
The bin number data 154 is output to the outside of the entropy encoder 115 from the switch 145 and the bit number data 155 is output to the outside of the entropy encoder 115 from the arithmetic encoder 148.
With the first related technique of the present invention, the quantization parameter 125 output from the code quantity control unit 105 shown in FIG. 3 is directly input to the context initializer 143. In other words, when the quantization parameter 125 output from the code quantity control unit 105 is referred to as quantization parameter for a quantization process and the quantization parameter 125 input to the context initializer 143 is referred to as slice quantization parameter, the quantization parameter for a quantization process and the slice quantization parameter are equal to each other.
On the other hand, a technique of varying a slice quantization parameter itself by means of a table is proposed (refer to, e.g., Patent Document 1: JP-A-2005-005862 [paragraph No. 0011, paragraphs No. 0033 through 0039, FIGS. 1 and 4]), which will be referred to as the second related technique of the present invention hereinafter. More specifically, with this technique, a reference quantization scale Qb defined by a code quantity control circuit is made to vary between 1/b and b times (where b is an adaptive level for each macroblock and indicates the control range relative to the reference quantization scale Qb) and to be used as a quantization scale at the time of coding.
The second related technique is designed to execute an adaptive quantization process that suppresses adverse effects to a code quantity control circuit and prevents image degradation from taking place particularly when the bit rate is low. Then, as a result, it is possible to suppress the compression ratio to below a predetermined level and also any visually noticeable degradation.
Meanwhile, if a macroblock that contains significant coefficients to a large extent appears at the head of a slice in the case of low bit rate coding conforming to the H.264 Standard, the quantity of generated codes of symbols of existence of significant coefficients (to be referred to as overhead code quantity hereinafter) extremely increases for the macroblock. Additionally, the overhead code quantity also extremely increases for a macroblock that contains significant coefficients to a large extent and appears after macroblocks that scarcely contain significant coefficients are coded successively from the head of a slice. Such a local increase of overhead code quantity is problematic because it not only entails degradation of image quality due to a reduced compression efficiency but also gives rise to a possibility of becoming no longer able to meet the requirement of the upper limit macroblock bit number defined in the H.264 Standard.
Such a problem is different from the technical problem to be solved by the second related technique of the present invention of making a reference quantization scale Qb vary between 1/b and b times. In other words, the problem cannot be solved by the second related technique of the present invention.